package com.sky.mapper;
import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    void insertDishFlavor(List<DishFlavor> flavors);

    //批量删除菜品关联的口味
    void deleteFlavorById(List<Long> ids);

    //根据菜品id删除对应的口味
    @Delete( "delete from dish_flavor where dish_id=#{id}")
    void delDishFlavorById(Long id);
    /**
     * 根据菜品id查询口味数据
     * @param id
     *
     */
    @Select("select *from dish_flavor where dish_id=#{id}")
    List<DishFlavor> getByDishId(Long id);
}
